# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        潘炎珍  
# Name:         demo09
# Description:
# Author:       98745
# Date:         2019/3/3
#-------------------------------------------------------------------------------

class R:
    def __init__(self):
        self.w=0
        self.h=0
        self.l=0
        self.t=0
    def __setattr__(self, key, value):
        print('{}被设置，新值为{}'.format(key,value))
        if key=='si':
            self.w,self.h=value
        elif key=='pos':
            self.l,self.t=value
        else:
            self.__dict__[key]=value
    def __getattr__(self,name):
        print('{}被获取'.format(name))
        if name=='si':
            return self.w,self.h
        elif name=='pos':
            return self.l,self.t
    def __delattr__(self,name):
        if name=='si':
            self.w,self.h=0,0
        elif name=='pos':
            self.l,self.t=0,0
r=R()
r.si=300,500
r.pos=100,400
print('si=',r.si)
print('pos=',r.pos)
del r.si,r.pos
print(r.si)
print(r.pos)

r.pan=12,23
print('pan=',r.pan)